<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: Widgets::TooltipHelper</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">Widgets::TooltipHelper</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/plugins/widgets/lib/widgets/tooltip_helper_rb.html">
                vendor/plugins/widgets/lib/widgets/tooltip_helper.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000013">close_tooltip_link</a>&nbsp;&nbsp;
      <a href="#M000015">css_template_filename</a>&nbsp;&nbsp;
      <a href="#M000014">render_tooltip</a>&nbsp;&nbsp;
      <a href="#M000008">tooltip</a>&nbsp;&nbsp;
      <a href="#M000010">tooltip_content</a>&nbsp;&nbsp;
      <a href="#M000009">tooltip_css</a>&nbsp;&nbsp;
      <a href="#M000011">tooltip_link</a>&nbsp;&nbsp;
      <a href="#M000012">tooltip_link_function</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name"><a href="CssTemplate.html">CssTemplate</a></span>
      </div>
    </div>

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000013" class="method-detail">
        <a name="M000013"></a>

        <div class="method-heading">
          <a href="#M000013" class="method-signature">
          <span class="method-name">close_tooltip_link</span><span class="method-args">(id, message = 'close')</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000013-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/widgets/lib/widgets/tooltip_helper.rb, line 50</span>
50:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close_tooltip_link</span>(<span class="ruby-identifier">id</span>, <span class="ruby-identifier">message</span> = <span class="ruby-value str">'close'</span>)
51:       <span class="ruby-identifier">message</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'close'</span> <span class="ruby-comment cmt"># if nil is passed I'll force it</span>
52:       <span class="ruby-identifier">link_to_function</span> <span class="ruby-identifier">message</span>, <span class="ruby-node">&quot;$('tooltip_#{id}').hide()&quot;</span>
53:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000015" class="method-detail">
        <a name="M000015"></a>

        <div class="method-heading">
          <a href="#M000015" class="method-signature">
          <span class="method-name">css_template_filename</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
return the name of the erb to parse for the default css generation
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000015-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/widgets/lib/widgets/tooltip_helper.rb, line 65</span>
65:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">css_template_filename</span>
66:       <span class="ruby-value str">'tooltip.css.erb'</span> 
67:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000014" class="method-detail">
        <a name="M000014"></a>

        <div class="method-heading">
          <a href="#M000014" class="method-signature">
          <span class="method-name">render_tooltip</span><span class="method-args">(name, content, opts)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000014-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/widgets/lib/widgets/tooltip_helper.rb, line 55</span>
55:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_tooltip</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">content</span>, <span class="ruby-identifier">opts</span>)
56:       <span class="ruby-identifier">html</span> = <span class="ruby-identifier">tag</span>(<span class="ruby-value str">'div'</span>, {<span class="ruby-identifier">:id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;tooltip_#{opts[:id]}&quot;</span>, <span class="ruby-identifier">:class</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">'tooltip'</span>, <span class="ruby-identifier">:style</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'display:none'</span>}, <span class="ruby-keyword kw">true</span>)
57:       <span class="ruby-identifier">html</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">tag</span>(<span class="ruby-value str">'div'</span>, {<span class="ruby-identifier">:id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;tooltip_content_#{opts[:id]}&quot;</span>, <span class="ruby-identifier">:class</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">'tooltip_content'</span>},<span class="ruby-keyword kw">true</span>)
58:       <span class="ruby-identifier">html</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">content</span>
59:       <span class="ruby-identifier">html</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'&lt;small&gt;'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">close_tooltip_link</span>(<span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:id</span>], <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:close_message</span>]) <span class="ruby-operator">+</span> <span class="ruby-value str">'&lt;/small&gt;'</span>     
60:       <span class="ruby-identifier">html</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'&lt;/div&gt;&lt;/div&gt;'</span> 
61:       <span class="ruby-identifier">html</span>
62:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000008" class="method-detail">
        <a name="M000008"></a>

        <div class="method-heading">
          <a href="#M000008" class="method-signature">
          <span class="method-name">tooltip</span><span class="method-args">(name=nil, opts={}, &amp;proc)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000008-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/widgets/lib/widgets/tooltip_helper.rb, line 5</span>
 5:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tooltip</span>(<span class="ruby-identifier">name</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">opts</span>={}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">proc</span>)
 6:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Hash</span>) <span class="ruby-comment cmt"># called like this: &lt;%= tooltip :name =&gt; 'aaa', :partial =&gt; 'mytooltip' %&gt;</span>
 7:         <span class="ruby-identifier">opts</span> = <span class="ruby-identifier">name</span>
 8:         <span class="ruby-identifier">name</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:name</span>]
 9:       <span class="ruby-keyword kw">end</span>
10:       
11:       <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:id</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">rand</span>(<span class="ruby-value">1000</span>)
12:       <span class="ruby-identifier">name</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">image_tag</span>(<span class="ruby-value str">'widgets/tooltip_image.gif'</span>, <span class="ruby-identifier">:border</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>)
13:  
14:       <span class="ruby-identifier">result</span> = <span class="ruby-value str">''</span>
15:       <span class="ruby-identifier">result</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">tooltip_css</span>
16:       <span class="ruby-identifier">result</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">tooltip_link</span>(<span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:id</span>],<span class="ruby-identifier">name</span>)
17:       <span class="ruby-identifier">result</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">javascript_tag</span>(<span class="ruby-identifier">tooltip_link_function</span>(<span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:id</span>]))
18:       <span class="ruby-identifier">result</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">render_tooltip</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">tooltip_content</span>(<span class="ruby-identifier">opts</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">proc</span>), <span class="ruby-identifier">opts</span>)
19:       
20:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
21:         <span class="ruby-identifier">concat</span> <span class="ruby-identifier">result</span>, <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">binding</span>; 
22:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
23:       <span class="ruby-keyword kw">else</span>
24:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
25:       <span class="ruby-keyword kw">end</span>
26:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000010" class="method-detail">
        <a name="M000010"></a>

        <div class="method-heading">
          <a href="#M000010" class="method-signature">
          <span class="method-name">tooltip_content</span><span class="method-args">(opts={}, &amp;proc)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000010-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/widgets/lib/widgets/tooltip_helper.rb, line 37</span>
37:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tooltip_content</span>(<span class="ruby-identifier">opts</span>={}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">proc</span>)
38:      <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">render</span>(<span class="ruby-identifier">:partial</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:partial</span>]) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:partial</span>]
39:      <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">capture</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">proc</span>)
40:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000009" class="method-detail">
        <a name="M000009"></a>

        <div class="method-heading">
          <a href="#M000009" class="method-signature">
          <span class="method-name">tooltip_css</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000009-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/widgets/lib/widgets/tooltip_helper.rb, line 28</span>
28:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tooltip_css</span>
29:       <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@_tooltip_css_done</span>
30:         <span class="ruby-ivar">@_tooltip_css_done</span> = <span class="ruby-keyword kw">true</span>
31:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">default_css</span>
32:       <span class="ruby-keyword kw">else</span>
33:         <span class="ruby-value str">''</span>
34:       <span class="ruby-keyword kw">end</span>
35:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000011" class="method-detail">
        <a name="M000011"></a>

        <div class="method-heading">
          <a href="#M000011" class="method-signature">
          <span class="method-name">tooltip_link</span><span class="method-args">(id, name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000011-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/widgets/lib/widgets/tooltip_helper.rb, line 42</span>
42:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tooltip_link</span>(<span class="ruby-identifier">id</span>, <span class="ruby-identifier">name</span>)
43:       <span class="ruby-identifier">link_to</span> <span class="ruby-identifier">name</span>, <span class="ruby-value str">'javascript:void(0)'</span>, <span class="ruby-identifier">:id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;tooltip_link_#{id}&quot;</span>
44:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000012" class="method-detail">
        <a name="M000012"></a>

        <div class="method-heading">
          <a href="#M000012" class="method-signature">
          <span class="method-name">tooltip_link_function</span><span class="method-args">(id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000012-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/widgets/lib/widgets/tooltip_helper.rb, line 46</span>
46:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tooltip_link_function</span>(<span class="ruby-identifier">id</span>)
47:       <span class="ruby-node">&quot;$('tooltip_link_#{id}').observe('click', function(event){toggleTooltip(event, $('tooltip_#{id}'))});&quot;</span>
48:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>